--
-- @Author:      feilong
-- @DateTime:    2020-01-08 13:05:48
-- @Description: 帐号处理


local skynet = require "skynet"
local cjson = require("cjson")

local Account = class("Account")

--构造函数
function Account:ctor(message_dispatch)

	self.message_dispatch = message_dispatch

	self:register()
end

--注册消息
function Account:register()	
	self.message_dispatch:registerSelf("verifyReq", handler(self,self.verifyReq))
	self.message_dispatch:registerSelf("touristRegisterReq", handler(self,self.touristRegisterReq))

end

function Account:start()
	self.node_message = global.node_message

end





---------------------------------------------------------
-- cmd
---------------------------------------------------------

--帐号验证
function Account:verifyReq(msg)

end

--游客注册
function Account:touristRegisterReq(fd, msg)
	local res = self.node_message:httpPost("./touristRegisterReq", msg) 
	res = cjson.decode(res)
	print("____res____", res)
	return {touristRegisterRes={
		key_token = res.key_token,
		uid = res.uid,
	}}
end








return Account